This relates generally to electronic devices and, more particularly, to electronic devices with proximity sensors.
Cellular telephones are sometimes provided with proximity sensors. For example, a cellular telephone may be provided with a proximity sensor that is located near an ear speaker on a front face of the cellular telephone.
The front face of the cellular telephone may also contain a touch screen display. The proximity sensor may be used to determine when the cellular telephone is near to the head of a user. When not in proximity to the head of the user, the cellular telephone may be placed in a normal mode of operation in which the touch screen display is used to present visual information to the user and in which the touch sensor portion of the touch screen is enabled. In response to determining that the cellular telephone has been brought into the vicinity of the user's head, the display may be disabled to conserve power and the touch sensor on the display may be temporarily disabled to avoid inadvertent touch input from contact between the user's head and the touch sensor.
A proximity sensor for use in a cellular telephone may be based on an infrared light-emitting diode and a corresponding infrared light detector. During operation, the light-emitting diode may emit infrared light outwards from the front face of the cellular telephone. When the cellular telephone is not in the vicinity of a user's head, the infrared light will not be reflected towards the light detector and only small amounts of reflected light will be detected by the light detector. When, however, the cellular telephone is adjacent to the user's head, the emitted light from the infrared light-emitting diode will be reflected from the user's head and detected by the light detector.
Light-based proximity sensors such as these may be used to detect the position of a cellular telephone relative to a user's head, but can be challenging to operate accurately. If care is not taken, it can be difficult to determine when a user's head is in the vicinity of the cellular telephone, particularly when a user has hair that is dark and exhibits low reflectivity or when the proximity sensor has become smudged with grease from the skin of the user.
It would therefore be desirable to be able to provide improved ways in which to use proximity sensors to accurately determine whether a user's head is in the vicinity of cellular telephone or other electronic device.